from host import Host
class State():
    def __init__(self, name: str):
        self.name = name
    
    def current_state(self):
        return self.name
    
    def transition(self, host: Host):
        pass

class low(State):
    def __init__(self):
        super().__init__("low_power")

    def transition(self, host: Host):
        if host.value < 10:
            host.value += 1
            print(f"{self.name} is in low power state. Value: {host.value}")
        else:
            print(f"{self.name} is in normal state. Value: {host.value}")
            return "normal"

class normal(State):
    def __init__(self):
        super().__init__("normal")

    def transition(self, host: Host):
        if host.value > 10:
            host.value -= 1
            print(f"{self.name} is in normal state. Value: {host.value}")
        else:
            print(f"{self.name} is in low power state. Value: {host.value}")
            return "low"